﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataService;
using DTO;

public partial class Admin_AdminMasterPage : System.Web.UI.MasterPage
{
    public const int PENDING_FILE = 1;
    private DeviceService service = new DeviceService();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session[BasePage.ADMIN_LOGIN_SESSION] != null)
        {
            lblInformatio.Text = ((Admin)Session[BasePage.ADMIN_LOGIN_SESSION]).Username + ", <a href='LogoutAdmin.aspx'>Logout</a>";
        }
        IList<Device> devices= service.GetListRequestDeviceByAll("", "", null, null, 0, PENDING_FILE);
        lblPending.Text = (devices.Count==0)?"": " (Pending: " + Convert.ToString(devices.Count) + ")";
    }
}
